/*
 * Common.h
 *
 *  Created on: Jun 28, 2009
 *      Author: mlrus
 */

#ifndef COMMON_H_
#define COMMON_H_

#include <string>

typedef u_int32_t uint;
typedef u_int16_t ushort;
typedef u_int8_t uchar;
typedef u_int8_t ubyte;

#define _USE_HASH_TABLE_

// The _BOUNDARY_BITS_ optimization navigates with bits instead of address computation.
// 1) adds six bits to each cell: rowZero, rowN, colZero, colN, rowBound and colBound
// 2) Board::getEndpoints references these bits instead of doing address computation.
// This optimization only helps in optimized code. This helps in ten out of ten cases
// (i.e., always) with the average improvement of 0.13 seconds (2.05 sec to 1.93 sec).
//
// Can improved but with more space required by storing the row/col per cell.

class Common {

	public:
		static const uchar EMPTYCHAR;
		static const std::string VALIDCHARS;
		static const std::string EMPTYSTRING;
		static std::string* EMPTYSTRINGPTR;
		static const uint debug;
		static const int boardSize = 15;
		static const int rackSize = 7;
		static const u_int32_t ANYLETTER = 0xFFFFFFFF; //~0xF8000000;

		static const std::string vertical;
		static const std::string horizontal;
		static const std::string point;
		static const std::string invalid;
		static const std::string err;

		Common() {
		}

		virtual ~Common() {
		}

};

#endif /* COMMON_H_ */
